package com.hy.common.utils;

import com.hy.common.consts.StateConst;
import org.springframework.stereotype.Component;


public class StateUtil {



    public  static String getSortMode(Integer state){
        String name;
        switch (state){
            case 1:
                name="按照管理部门分类";
                break;
            case 2:
                name="按照资产类别划分";
                break;
            case 3:
                name="按照管理人划分";
                break;
            case 4:
                name="按照存放区域分类";
                break;
            default:
                name="未识别的信号量";
        }
        return name;
    }

//资产状态 1：在用、2：待修、3：在修、4：备用、5：闲置、6：调剂、7：待报废、8：报废
    public static String getPropertyState(Integer state){
        String name;
        switch (state){
            case 1:
                name="在用";
                break;
            case 2:
                name="待修";
                break;
            case 3:
                name="在修";
                break;
            case 4:
                name="备用";
                break;
            case 5:
                name="闲置";
                break;
            case 6:
                name="调剂";
                break;
            case 7:
                name="待报废";
                break;
            case 8:
                name="报废";
                break;
            default:
                name="未识别的信号量";
        }
        return name;
    }
    public static Integer getPropertyStateCode(String state){
        Integer name;
        switch (state){
            case "在用":
                name=1;
                break;
            case "待修":
                name=2;
                break;
            case "在修":
                name=3;
                break;
            case "备用":
                name=4;
                break;
            case "闲置":
                name=5;
                break;
            case "调剂":
                name=6;
                break;
            case "待报废":
                name=7;
                break;
            case "报废":
                name=8;
                break;
            case "待确认":
                name=9;
                break;
            default:
                name=0;
        }
        return name;
    }

    public static String getOutState(Integer state){
        String outName;
        switch (state){
            case 1:
                outName="不是";
                break;
            case 2:
                outName="是";
                break;
            default:
                outName="未识别的信号量";
        }
        return outName;
    }

    public static Integer getOutStateCode(String state){
        Integer outName;
        switch (state){
            case "不是":
                outName=1;
                break;
            case "是":
                outName=2;
                break;
            default:
                outName=0;
        }
        return outName;
    }


    public static Integer getSex(String state){
        Integer outName;
        switch (state){
            case "男":
                outName=1;
                break;
            case "女":
                outName=2;
                break;
            default:
                outName=0;
        }
        return outName;
    }
    public static String getSex(Integer state){
        String outName="";
        switch (state){
            case 1:
                outName=outName+"男";
                break;
            case 2:
                outName=outName+"女";
                break;
            default:
                outName="未知";
        }
        return outName;
    }
    public static String getDetectDetail(Integer state){
        String outName="";
        switch (state){
            case 1:
                outName=outName+"正常";
                break;
            case 2:
                outName=outName+"盘亏";
                break;
                case 3:
                outName=outName+"盘盈";
                break;
                case 4:
                outName=outName+"异常";
                break;
                case 5:
                outName=outName+"待确认";
                break;
            default:
                outName="未知";
        }
        return outName;
    }

}
